import { EnableItemReq } from "./models";
import req, { ResponseData } from "/@/api/req";

export enum Api {
  addGatewayCredentials = "api/aiot/gatewayCredentials/addGatewayCredentials",
  enableGatewayCredentials = "api/aiot/gatewayCredentials/enableGatewayCredentials",
  getPage = "api/aiot/gatewayCredentials/page",
  updateGatewayCredentials = "api/aiot/gatewayCredentials/updateGatewayCredentials",
  upload = "api/aiot/gatewayCredentials/upload",
}

export function enableGatewayCredentials(data: EnableItemReq) {
  return req.post<boolean>(
    {
      url: Api.enableGatewayCredentials,
      data,
    },
    {
      useGlobalLoading: false,
    }
  );
}
export function uploadFile(data: FormData) {
  return req.post<string>(
    {
      url: Api.upload,
      data,
    },
    {
      useGlobalLoading: false,
    }
  );
}
